<template>
	<view class="history-notice">
		<view class="history-notice-item" v-for="(item,index) in historyList" :key="index"
			@click="goTo('/pages/historynotice/NoticeDetail')">
			<view class="title">
				<text class="circle" :class="{'red':!index}"></text>
				<text class="title-cont">
					{{item.title}}
				</text>
			</view>
			<view style="margin: 0 0 0 30rpx;">
				{{item.time}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				historyList: [{
						id: 1,
						title: '公告标题题题公告标题标题',
						time: '2033-11-06 09:27:27'
					},
					{
						id: 2,
						title: '公告标题公告标题公公告标题公告标题',
						time: '2033-11-06 09:27:27'
					}, {
						id: 3,
						title: '公告告标题公告标题',
						time: '2033-11-06 09:27:27'
					}, {
						id: 4,
						title: '公告标题公告标题公公告标题公告标题',
						time: '2033-11-06 09:27:27'
					}, {
						id: 5,
						title: '公告标题标题公告标题公告标题公告标题标题公告标题公告标题',
						time: '2033-11-06 09:27:27'
					}
				]
			}
		},
		methods: {
			goTo(url) {
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #fff;
	}

	.history-notice {
		width: 100vw;
		padding: 0 30rpx;

		&-item {
			padding: 24rpx 0;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
			font-size: 22rpx;
			color: #999;

			.title {
				display: flex;
				align-items: center;
				width: 656rpx;
				margin-bottom: 20rpx;
				font-size: 28rpx;
				color: #333;

				.circle {
					display: inline-block;
					width: 16rpx;
					height: 16rpx;
					border-radius: 50%;
					background: #fff;
					margin: 0 10rpx 0 0;

					&.red {
						background: #FE245E;
					}
				}

				.title-cont {
					display: inline-block;
					width: 626rpx;

					text-overflow: ellipsis;
					white-space: nowrap;
					overflow: hidden;
				}
			}
		}
	}
</style>